import React from 'react';
import lefts from './../css/scss/left.scss';
// import menu from './commonui/menu';
import { createStore } from 'redux';
import test1 from './../test1'; //测试文件夹名
const fn = (state = 0, action) => {
    switch (action.type) {
    case 'INCREMENT':
      return state + 1
    case 'DECREMENT':
      return state - 1
    default:
      return state
  }
}
const store = createStore(fn);
export default class leftMenu extends React.Component {
    constructor(props) {
        super(props); 
        store.subscribe(()=>{
            return this.render();
        });
    } 
    click_INCREMENT() {
        store.dispatch({ type: 'INCREMENT' })
    }
    click_DECREMENT() {
        store.dispatch({ type: 'DECREMENT' })
    }
    render() {
        let value = store.getState();
        return (
            <div id={lefts.main}>
                <p>this is a main<p className={lefts.redbox}>this is a connt</p></p>
                <p className={lefts.redbox}>this is a redbox</p>
                <p className={lefts.redbox}>this is a redbox1</p>
                <p className={lefts.redbox}>this is a redbox6</p>
                <p onClick={this.click_INCREMENT} className={lefts.redbox}>{value}</p>
                <p onClick={this.click_DECREMENT} className={lefts.redbox}>{value}</p>
            </div>
        )
    }
}
// state.subscribe(leftMenu.render()) 